package com.gt.quality.apim.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.gt.quality.apim.domain.ApiDataInfo;
import com.gt.quality.apim.domain.ApiParamInfo;
import com.gt.quality.apim.domain.vo.ApiDataInfoVo;
import com.gt.quality.base.pojo.BaseLimitRequest;
import com.gt.quality.base.pojo.Resp;

import java.io.Serializable;
import java.util.List;

/**
 * API数据集表(ApiDataInfo)表服务接口
 *
 * @author makejava
 * @since 2026-11-20 09:37:49
 */
public interface ApiDataInfoService extends IService<ApiDataInfo> {

/**
     * Description:  分页查询
     *
     * @param limitRequest 分页查询参数
     * @author: makeJava
     * @date: com.sjhy.plugin.tool.TimeUtils@65a47fee
     * @return:com.baomidou.mybatisplus.core.metadata.IPage
     */
    IPage<ApiDataInfo> queryLimitPage(BaseLimitRequest<ApiDataInfo> limitRequest);


    /**
     * Description:  批量新增
     *
     * @param entityList entityList
     * @author: makeJava
     * @date: com.sjhy.plugin.tool.TimeUtils@65a47fee
     * @return:Integer
     */
    Integer saveBatchByEasyBaseMapper(List<ApiDataInfo> entityList);

    boolean saveApiInfoAndParam(ApiDataInfoVo bean);

    /**
     * 执行远程API
     * @param apiDataInfo apiDataInfo
     * @return R<Object>
     */
    Resp<Object> executeApi(ApiDataInfoVo apiDataInfo);

    /**
     * 主子表级联查询
     * @param id
     * @return
     */
    ApiDataInfoVo getByIdAndSon(Serializable id);

    /**
     * 级联删除主子表
     * @param idList idList
     * @return boolean
     */
    boolean removeByIdsAndSon(List<Long> idList);

    /**
     * 执行API
     * @param apiParamInfoList apiParamInfoList
     * @return R
     */
    Resp<Object> executeApiByListApiParam(List<ApiParamInfo> apiParamInfoList);

    /**
     * 编辑子项就先移除再新增
     * @param id id
     * @param apiParamInfoList apiParamInfoList
     */
    void beforeDeleteParamListAndNewInsert(Long id, List<ApiParamInfo> apiParamInfoList);
}


